template<int Cols> void solve_direct(const Matrix<2>& A, const Matrix<2, Cols>& b, Matrix<2,Cols>& x)
{
      double t0 = A[0][0]*A[1][1]-A[0][1]*A[1][0];
	double idet = 1/t0;
                                            t0 = A[1][1];
	double i00 = t0*idet;
                                                  t0 = -A[0][1];
	double i01 = t0*idet;
                                                  t0 = -A[1][0];
	double i10 = t0*idet;
                                                  t0 = A[0][0];
	double i11 = t0*idet;
	for(unsigned int i=0; i < x.num_cols(); i++)
	{
		x[0][i] = i00*b[0][i] + i01*b[1][i];
		x[1][i] = i10*b[0][i] + i11*b[1][i];
	}
}
template<int Cols> void solve_direct(const Matrix<3>& A, const Matrix<3, Cols>& b, Matrix<3,Cols>& x)
{
      double t0 = A[0][0]*A[1][1]*A[2][2]-A[0][0]*A[1][2]*A[2][1]-A[1][0]*A[0][1]*A[2][2]+A[1][0]*A[0][2]*A[2][1]+A[2][0]*A[0][1]*A[1][2]-A[2][0]*A[0][2]*A[1][1];
	double idet = 1/t0;
                                            t0 = A[1][1]*A[2][2]-A[1][2]*A[2][1];
	double i00 = t0*idet;
                                                  t0 = -A[0][1]*A[2][2]+A[0][2]*A[2][1];
	double i01 = t0*idet;
                                                  t0 = A[0][1]*A[1][2]-A[0][2]*A[1][1];
	double i02 = t0*idet;
                                                  t0 = -A[1][0]*A[2][2]+A[1][2]*A[2][0];
	double i10 = t0*idet;
                                                  t0 = A[0][0]*A[2][2]-A[0][2]*A[2][0];
	double i11 = t0*idet;
                                                  t0 = -A[0][0]*A[1][2]+A[0][2]*A[1][0];
	double i12 = t0*idet;
                                                  t0 = A[1][0]*A[2][1]-A[1][1]*A[2][0];
	double i20 = t0*idet;
                                                  t0 = -A[0][0]*A[2][1]+A[0][1]*A[2][0];
	double i21 = t0*idet;
                                                  t0 = A[0][0]*A[1][1]-A[0][1]*A[1][0];
	double i22 = t0*idet;
	for(unsigned int i=0; i < x.num_cols(); i++)
	{
		x[0][i] = i00*b[0][i] + i01*b[1][i] + i02*b[2][i];
		x[1][i] = i10*b[0][i] + i11*b[1][i] + i12*b[2][i];
		x[2][i] = i20*b[0][i] + i21*b[1][i] + i22*b[2][i];
	}
}
template<int Cols> void solve_direct(const Matrix<4>& A, const Matrix<4, Cols>& b, Matrix<4,Cols>& x)
{
      double t0 = A[0][0]*A[1][1]*A[2][2]*A[3][3]-A[0][0]*A[1][1]*A[2][3]*A[3][2]-A[0][0]*A[2][1]*A[1][2]*A[3][3]+A[0][0]*A[2][1]*A[1][3]*A[3][2]+A[0][0]*A[3][1]*A[1][2]*A[2][3]-A[0][0]*A[3][1]*A[1][3]*A[2][2]-A[1][0]*A[0][1]*A[2][2]*A[3][3]+A[1][0]*A[0][1]*A[2][3]*A[3][2]+A[1][0]*A[2][1]*A[0][2]*A[3][3]-A[1][0]*A[2][1]*A[0][3]*A[3][2]-A[1][0]*A[3][1]*A[0][2]*A[2][3]+A[1][0]*A[3][1]*A[0][3]*A[2][2]+A[2][0]*A[0][1]*A[1][2]*A[3][3]-A[2][0]*A[0][1]*A[1][3]*A[3][2]-A[2][0]*A[1][1]*A[0][2]*A[3][3]+A[2][0]*A[1][1]*A[0][3]*A[3][2]+A[2][0]*A[3][1]*A[0][2]*A[1][3]-A[2][0]*A[3][1]*A[0][3]*A[1][2]-A[3][0]*A[0][1]*A[1][2]*A[2][3]+A[3][0]*A[0][1]*A[1][3]*A[2][2]+A[3][0]*A[1][1]*A[0][2]*A[2][3]-A[3][0]*A[1][1]*A[0][3]*A[2][2]-A[3][0]*A[2][1]*A[0][2]*A[1][3]+A[3][0]*A[2][1]*A[0][3]*A[1][2];
	double idet = 1/t0;
                                            t0 = A[1][1]*A[2][2]*A[3][3]-A[1][1]*A[2][3]*A[3][2]-A[2][1]*A[1][2]*A[3][3]+A[2][1]*A[1][3]*A[3][2]+A[3][1]*A[1][2]*A[2][3]-A[3][1]*A[1][3]*A[2][2];
	double i00 = t0*idet;
                                                  t0 = -A[0][1]*A[2][2]*A[3][3]+A[0][1]*A[2][3]*A[3][2]+A[2][1]*A[0][2]*A[3][3]-A[2][1]*A[0][3]*A[3][2]-A[3][1]*A[0][2]*A[2][3]+A[3][1]*A[0][3]*A[2][2];
	double i01 = t0*idet;
                                                  t0 = A[0][1]*A[1][2]*A[3][3]-A[0][1]*A[1][3]*A[3][2]-A[1][1]*A[0][2]*A[3][3]+A[1][1]*A[0][3]*A[3][2]+A[3][1]*A[0][2]*A[1][3]-A[3][1]*A[0][3]*A[1][2];
	double i02 = t0*idet;
                                                  t0 = -A[0][1]*A[1][2]*A[2][3]+A[0][1]*A[1][3]*A[2][2]+A[1][1]*A[0][2]*A[2][3]-A[1][1]*A[0][3]*A[2][2]-A[2][1]*A[0][2]*A[1][3]+A[2][1]*A[0][3]*A[1][2];
	double i03 = t0*idet;
                                                  t0 = -A[1][0]*A[2][2]*A[3][3]+A[1][0]*A[2][3]*A[3][2]+A[2][0]*A[1][2]*A[3][3]-A[2][0]*A[1][3]*A[3][2]-A[3][0]*A[1][2]*A[2][3]+A[3][0]*A[1][3]*A[2][2];
	double i10 = t0*idet;
                                                  t0 = A[0][0]*A[2][2]*A[3][3]-A[0][0]*A[2][3]*A[3][2]-A[2][0]*A[0][2]*A[3][3]+A[2][0]*A[0][3]*A[3][2]+A[3][0]*A[0][2]*A[2][3]-A[3][0]*A[0][3]*A[2][2];
	double i11 = t0*idet;
                                                  t0 = -A[0][0]*A[1][2]*A[3][3]+A[0][0]*A[1][3]*A[3][2]+A[1][0]*A[0][2]*A[3][3]-A[1][0]*A[0][3]*A[3][2]-A[3][0]*A[0][2]*A[1][3]+A[3][0]*A[0][3]*A[1][2];
	double i12 = t0*idet;
                                                  t0 = A[0][0]*A[1][2]*A[2][3]-A[0][0]*A[1][3]*A[2][2]-A[1][0]*A[0][2]*A[2][3]+A[1][0]*A[0][3]*A[2][2]+A[2][0]*A[0][2]*A[1][3]-A[2][0]*A[0][3]*A[1][2];
	double i13 = t0*idet;
                                                  t0 = A[1][0]*A[2][1]*A[3][3]-A[1][0]*A[2][3]*A[3][1]-A[2][0]*A[1][1]*A[3][3]+A[2][0]*A[1][3]*A[3][1]+A[3][0]*A[1][1]*A[2][3]-A[3][0]*A[1][3]*A[2][1];
	double i20 = t0*idet;
                                                  t0 = -A[0][0]*A[2][1]*A[3][3]+A[0][0]*A[2][3]*A[3][1]+A[2][0]*A[0][1]*A[3][3]-A[2][0]*A[0][3]*A[3][1]-A[3][0]*A[0][1]*A[2][3]+A[3][0]*A[0][3]*A[2][1];
	double i21 = t0*idet;
                                                  t0 = A[0][0]*A[1][1]*A[3][3]-A[0][0]*A[1][3]*A[3][1]-A[1][0]*A[0][1]*A[3][3]+A[1][0]*A[0][3]*A[3][1]+A[3][0]*A[0][1]*A[1][3]-A[3][0]*A[0][3]*A[1][1];
	double i22 = t0*idet;
                                                  t0 = -A[0][0]*A[1][1]*A[2][3]+A[0][0]*A[1][3]*A[2][1]+A[1][0]*A[0][1]*A[2][3]-A[1][0]*A[0][3]*A[2][1]-A[2][0]*A[0][1]*A[1][3]+A[2][0]*A[0][3]*A[1][1];
	double i23 = t0*idet;
                                                  t0 = -A[1][0]*A[2][1]*A[3][2]+A[1][0]*A[2][2]*A[3][1]+A[2][0]*A[1][1]*A[3][2]-A[2][0]*A[1][2]*A[3][1]-A[3][0]*A[1][1]*A[2][2]+A[3][0]*A[1][2]*A[2][1];
	double i30 = t0*idet;
                                                  t0 = A[0][0]*A[2][1]*A[3][2]-A[0][0]*A[2][2]*A[3][1]-A[2][0]*A[0][1]*A[3][2]+A[2][0]*A[0][2]*A[3][1]+A[3][0]*A[0][1]*A[2][2]-A[3][0]*A[0][2]*A[2][1];
	double i31 = t0*idet;
                                                  t0 = -A[0][0]*A[1][1]*A[3][2]+A[0][0]*A[1][2]*A[3][1]+A[1][0]*A[0][1]*A[3][2]-A[1][0]*A[0][2]*A[3][1]-A[3][0]*A[0][1]*A[1][2]+A[3][0]*A[0][2]*A[1][1];
	double i32 = t0*idet;
                                                  t0 = A[0][0]*A[1][1]*A[2][2]-A[0][0]*A[1][2]*A[2][1]-A[1][0]*A[0][1]*A[2][2]+A[1][0]*A[0][2]*A[2][1]+A[2][0]*A[0][1]*A[1][2]-A[2][0]*A[0][2]*A[1][1];
	double i33 = t0*idet;
	for(unsigned int i=0; i < x.num_cols(); i++)
	{
		x[0][i] = i00*b[0][i] + i01*b[1][i] + i02*b[2][i] + i03*b[3][i];
		x[1][i] = i10*b[0][i] + i11*b[1][i] + i12*b[2][i] + i13*b[3][i];
		x[2][i] = i20*b[0][i] + i21*b[1][i] + i22*b[2][i] + i23*b[3][i];
		x[3][i] = i30*b[0][i] + i31*b[1][i] + i32*b[2][i] + i33*b[3][i];
	}
}
template<int Cols> void solve_direct(const Matrix<5>& A, const Matrix<5, Cols>& b, Matrix<5,Cols>& x)
{
      double MapleGenVar3 = A[1][1]*A[2][2]*A[4][3]*A[3][0]*A[0][4]+A[1][1]*A[2][2]*A[4][0]*A[0][3]*A[3][4]-A[1][1]*A[2][2]*A[3][3]*A[4][0]*A[0][4]-A[1][1]*A[2][2]*A[3][0]*A[0][3]*A[4][4]-A[1][1]*A[3][3]*A[2][0]*A[0][2]*A[4][4]-A[1][1]*A[4][2]*A[2][3]*A[3][0]*A[0][4]-A[1][1]*A[4][0]*A[0][3]*A[3][2]*A[2][4]-A[1][1]*A[4][0]*A[0][2]*A[2][3]*A[3][4]+A[1][1]*A[2][3]*A[3][2]*A[4][0]*A[0][4]-A[1][1]*A[4][3]*A[3][0]*A[0][2]*A[2][4]+A[1][1]*A[3][3]*A[4][2]*A[2][0]*A[0][4]+A[1][1]*A[2][0]*A[0][3]*A[3][2]*A[4][4]-A[1][1]*A[4][3]*A[3][2]*A[2][0]*A[0][4]+A[1][1]*A[3][0]*A[0][2]*A[2][3]*A[4][4]+A[1][1]*A[4][3]*A[2][0]*A[0][2]*A[3][4];
      double MapleGenVar2 = MapleGenVar3+A[1][1]*A[3][3]*A[4][0]*A[0][2]*A[2][4]-A[1][1]*A[4][2]*A[2][0]*A[0][3]*A[3][4]+A[1][1]*A[3][0]*A[0][3]*A[4][2]*A[2][4]-A[2][2]*A[4][3]*A[3][0]*A[0][1]*A[1][4]-A[0][0]*A[4][3]*A[1][2]*A[3][1]*A[2][4]-A[0][0]*A[4][1]*A[1][3]*A[3][2]*A[2][4]-A[2][2]*A[4][1]*A[1][0]*A[0][3]*A[3][4]+A[4][1]*A[1][0]*A[0][3]*A[3][2]*A[2][4]-A[2][2]*A[3][3]*A[1][0]*A[0][1]*A[4][4]-A[2][0]*A[0][1]*A[1][3]*A[3][2]*A[4][4]+A[4][3]*A[3][2]*A[2][0]*A[0][1]*A[1][4]-A[2][0]*A[3][1]*A[0][3]*A[1][2]*A[4][4]-A[2][0]*A[0][3]*A[3][2]*A[4][1]*A[1][4]-A[3][0]*A[0][1]*A[1][2]*A[2][3]*A[4][4]+A[3][1]*A[1][3]*A[2][0]*A[0][2]*A[4][4];
      MapleGenVar3 = MapleGenVar2-A[4][3]*A[2][0]*A[0][1]*A[1][2]*A[3][4]+A[4][1]*A[1][2]*A[2][3]*A[3][0]*A[0][4]-A[3][1]*A[1][2]*A[2][3]*A[4][0]*A[0][4]+A[3][0]*A[0][3]*A[1][2]*A[2][1]*A[4][4]-A[3][0]*A[0][3]*A[4][2]*A[2][1]*A[1][4]-A[3][1]*A[1][3]*A[4][2]*A[2][0]*A[0][4]-A[3][0]*A[0][2]*A[2][3]*A[4][1]*A[1][4]-A[1][0]*A[3][1]*A[0][2]*A[2][3]*A[4][4]-A[1][0]*A[3][1]*A[0][3]*A[4][2]*A[2][4]-A[3][0]*A[0][3]*A[4][1]*A[1][2]*A[2][4]-A[3][1]*A[1][3]*A[4][0]*A[0][2]*A[2][4]+A[4][3]*A[3][2]*A[2][1]*A[1][0]*A[0][4]+A[4][2]*A[1][3]*A[2][1]*A[3][0]*A[0][4]-A[1][0]*A[2][1]*A[0][3]*A[3][2]*A[4][4];
      double MapleGenVar1 = MapleGenVar3-A[3][3]*A[4][0]*A[0][2]*A[2][1]*A[1][4]-A[3][3]*A[4][0]*A[0][1]*A[1][2]*A[2][4]+A[3][3]*A[4][2]*A[1][0]*A[0][1]*A[2][4]-A[3][3]*A[4][2]*A[2][0]*A[0][1]*A[1][4]-A[3][0]*A[2][1]*A[0][2]*A[1][3]*A[4][4]-A[3][0]*A[0][1]*A[1][3]*A[4][2]*A[2][4]+A[4][2]*A[2][3]*A[3][1]*A[1][0]*A[0][4]-A[4][2]*A[2][3]*A[1][0]*A[0][1]*A[3][4]+A[4][2]*A[2][3]*A[3][0]*A[0][1]*A[1][4]+A[4][0]*A[0][1]*A[1][3]*A[3][2]*A[2][4]+A[4][1]*A[1][2]*A[2][0]*A[0][3]*A[3][4]-A[4][3]*A[1][2]*A[2][1]*A[3][0]*A[0][4]-A[4][3]*A[1][0]*A[0][2]*A[2][1]*A[3][4]+A[4][3]*A[1][2]*A[3][1]*A[2][0]*A[0][4]+A[4][3]*A[3][0]*A[0][2]*A[2][1]*A[1][4]+A[3][3]*A[1][2]*A[2][1]*A[4][0]*A[0][4];
      MapleGenVar3 = A[4][0]*A[0][2]*A[2][3]*A[3][1]*A[1][4]-A[4][0]*A[0][3]*A[1][2]*A[2][1]*A[3][4]+A[4][0]*A[0][3]*A[1][2]*A[3][1]*A[2][4]+A[4][0]*A[0][3]*A[3][2]*A[2][1]*A[1][4]+A[4][2]*A[2][0]*A[0][1]*A[1][3]*A[3][4]+A[4][1]*A[1][3]*A[3][0]*A[0][2]*A[2][4]-A[4][1]*A[1][3]*A[2][0]*A[0][2]*A[3][4]+A[3][3]*A[2][0]*A[0][1]*A[1][2]*A[4][4]+A[3][3]*A[2][0]*A[0][2]*A[4][1]*A[1][4]+A[3][3]*A[1][0]*A[0][2]*A[2][1]*A[4][4]-A[3][3]*A[4][1]*A[1][2]*A[2][0]*A[0][4]-A[3][3]*A[4][2]*A[2][1]*A[1][0]*A[0][4]+A[4][2]*A[1][0]*A[0][3]*A[2][1]*A[3][4]-A[2][1]*A[1][3]*A[3][2]*A[4][0]*A[0][4]+A[4][3]*A[1][0]*A[0][2]*A[3][1]*A[2][4];
      MapleGenVar2 = MapleGenVar3+A[4][3]*A[3][0]*A[0][1]*A[1][2]*A[2][4]+A[4][0]*A[0][2]*A[1][3]*A[2][1]*A[3][4]-A[4][3]*A[3][2]*A[1][0]*A[0][1]*A[2][4]-A[4][3]*A[2][0]*A[0][2]*A[3][1]*A[1][4]+A[4][2]*A[2][0]*A[0][3]*A[3][1]*A[1][4]-A[3][3]*A[4][1]*A[1][0]*A[0][2]*A[2][4]+A[2][2]*A[3][3]*A[4][0]*A[0][1]*A[1][4]-A[2][3]*A[3][2]*A[4][1]*A[1][0]*A[0][4]+A[2][3]*A[3][2]*A[1][0]*A[0][1]*A[4][4]-A[2][3]*A[3][2]*A[4][0]*A[0][1]*A[1][4]+A[4][1]*A[1][3]*A[3][2]*A[2][0]*A[0][4]+A[2][2]*A[3][0]*A[0][3]*A[4][1]*A[1][4]+A[2][2]*A[4][3]*A[1][0]*A[0][1]*A[3][4]+A[2][2]*A[1][0]*A[3][1]*A[0][3]*A[4][4]+A[2][2]*A[3][1]*A[1][3]*A[4][0]*A[0][4];
      MapleGenVar3 = A[2][2]*A[3][3]*A[4][1]*A[1][0]*A[0][4]-A[2][2]*A[4][1]*A[1][3]*A[3][0]*A[0][4]-A[2][2]*A[4][0]*A[0][3]*A[3][1]*A[1][4]-A[2][2]*A[4][0]*A[0][1]*A[1][3]*A[3][4]+A[2][2]*A[3][0]*A[0][1]*A[1][3]*A[4][4]-A[2][2]*A[4][3]*A[3][1]*A[1][0]*A[0][4]+A[4][0]*A[0][1]*A[1][2]*A[2][3]*A[3][4]+A[4][1]*A[1][0]*A[0][2]*A[2][3]*A[3][4]-A[0][0]*A[1][1]*A[2][2]*A[4][3]*A[3][4]+A[0][0]*A[1][1]*A[2][2]*A[3][3]*A[4][4]+A[0][0]*A[1][1]*A[4][2]*A[2][3]*A[3][4]-A[0][0]*A[1][1]*A[2][3]*A[3][2]*A[4][4]+A[0][0]*A[1][1]*A[4][3]*A[3][2]*A[2][4]-A[0][0]*A[1][1]*A[3][3]*A[4][2]*A[2][4]-A[0][0]*A[2][2]*A[3][1]*A[1][3]*A[4][4]+A[0][0]*A[2][2]*A[4][3]*A[3][1]*A[1][4];
      double t0 = MapleGenVar3+A[0][0]*A[2][2]*A[4][1]*A[1][3]*A[3][4]-A[0][0]*A[2][2]*A[3][3]*A[4][1]*A[1][4]-A[0][0]*A[4][2]*A[2][3]*A[3][1]*A[1][4]-A[0][0]*A[4][1]*A[1][2]*A[2][3]*A[3][4]+A[0][0]*A[3][3]*A[4][2]*A[2][1]*A[1][4]+A[0][0]*A[2][3]*A[3][2]*A[4][1]*A[1][4]+A[0][0]*A[4][3]*A[1][2]*A[2][1]*A[3][4]-A[0][0]*A[3][3]*A[1][2]*A[2][1]*A[4][4]+A[0][0]*A[3][3]*A[4][1]*A[1][2]*A[2][4]-A[0][0]*A[4][3]*A[3][2]*A[2][1]*A[1][4]+A[0][0]*A[3][1]*A[1][2]*A[2][3]*A[4][4]+A[0][0]*A[3][1]*A[1][3]*A[4][2]*A[2][4]+A[0][0]*A[2][1]*A[1][3]*A[3][2]*A[4][4]-A[0][0]*A[4][2]*A[1][3]*A[2][1]*A[3][4]+MapleGenVar2+MapleGenVar1;
	double idet = 1/t0;
                                            t0 = -A[1][1]*A[2][2]*A[4][3]*A[3][4]+A[1][1]*A[2][2]*A[3][3]*A[4][4]+A[1][1]*A[4][2]*A[2][3]*A[3][4]-A[1][1]*A[2][3]*A[3][2]*A[4][4]+A[1][1]*A[4][3]*A[3][2]*A[2][4]-A[1][1]*A[3][3]*A[4][2]*A[2][4]-A[2][2]*A[3][1]*A[1][3]*A[4][4]+A[2][2]*A[4][3]*A[3][1]*A[1][4]+A[2][2]*A[4][1]*A[1][3]*A[3][4]-A[2][2]*A[3][3]*A[4][1]*A[1][4]-A[4][2]*A[2][3]*A[3][1]*A[1][4]-A[4][1]*A[1][2]*A[2][3]*A[3][4]+A[3][3]*A[4][2]*A[2][1]*A[1][4]+A[2][3]*A[3][2]*A[4][1]*A[1][4]-A[4][3]*A[1][2]*A[3][1]*A[2][4]+A[4][3]*A[1][2]*A[2][1]*A[3][4]-A[3][3]*A[1][2]*A[2][1]*A[4][4]-A[4][1]*A[1][3]*A[3][2]*A[2][4]+A[3][3]*A[4][1]*A[1][2]*A[2][4]-A[4][3]*A[3][2]*A[2][1]*A[1][4]+A[3][1]*A[1][2]*A[2][3]*A[4][4]+A[3][1]*A[1][3]*A[4][2]*A[2][4]+A[2][1]*A[1][3]*A[3][2]*A[4][4]-A[4][2]*A[1][3]*A[2][1]*A[3][4];
	double i00 = t0*idet;
                                                  t0 = A[4][4]*A[0][1]*A[2][3]*A[3][2]-A[0][4]*A[2][3]*A[3][2]*A[4][1]+A[2][2]*A[4][4]*A[3][1]*A[0][3]-A[4][4]*A[2][1]*A[0][3]*A[3][2]+A[3][3]*A[4][2]*A[2][4]*A[0][1]-A[4][3]*A[3][4]*A[2][1]*A[0][2]-A[4][4]*A[3][1]*A[0][2]*A[2][3]+A[2][2]*A[3][3]*A[0][4]*A[4][1]-A[4][2]*A[2][3]*A[3][4]*A[0][1]-A[2][2]*A[0][3]*A[3][4]*A[4][1]+A[0][4]*A[4][2]*A[2][3]*A[3][1]+A[0][4]*A[4][3]*A[2][1]*A[3][2]-A[2][2]*A[0][4]*A[4][3]*A[3][1]+A[3][3]*A[4][4]*A[2][1]*A[0][2]+A[0][2]*A[2][3]*A[3][4]*A[4][1]-A[3][3]*A[0][4]*A[4][2]*A[2][1]+A[0][3]*A[3][4]*A[4][2]*A[2][1]+A[2][2]*A[4][3]*A[3][4]*A[0][1]+A[0][2]*A[2][4]*A[4][3]*A[3][1]+A[0][3]*A[3][2]*A[2][4]*A[4][1]-A[2][2]*A[3][3]*A[4][4]*A[0][1]-A[4][3]*A[3][2]*A[2][4]*A[0][1]-A[4][2]*A[2][4]*A[3][1]*A[0][3]-A[3][3]*A[0][2]*A[2][4]*A[4][1];
	double i01 = t0*idet;
                                                  t0 = A[1][1]*A[3][3]*A[0][4]*A[4][2]-A[1][1]*A[3][3]*A[4][4]*A[0][2]-A[1][1]*A[0][3]*A[3][4]*A[4][2]-A[1][1]*A[0][4]*A[4][3]*A[3][2]+A[1][1]*A[4][4]*A[0][3]*A[3][2]+A[1][1]*A[4][3]*A[3][4]*A[0][2]-A[3][3]*A[0][1]*A[1][4]*A[4][2]-A[3][3]*A[0][4]*A[4][1]*A[1][2]+A[3][3]*A[4][1]*A[1][4]*A[0][2]+A[3][3]*A[4][4]*A[0][1]*A[1][2]-A[4][3]*A[3][4]*A[0][1]*A[1][2]-A[4][1]*A[1][3]*A[3][4]*A[0][2]+A[3][1]*A[1][3]*A[4][4]*A[0][2]+A[0][1]*A[1][3]*A[3][4]*A[4][2]-A[4][4]*A[0][1]*A[1][3]*A[3][2]+A[0][4]*A[4][3]*A[1][2]*A[3][1]-A[4][1]*A[1][4]*A[0][3]*A[3][2]+A[0][4]*A[4][1]*A[1][3]*A[3][2]-A[4][3]*A[3][1]*A[1][4]*A[0][2]+A[0][1]*A[1][4]*A[4][3]*A[3][2]-A[0][4]*A[3][1]*A[1][3]*A[4][2]+A[0][3]*A[3][4]*A[4][1]*A[1][2]-A[4][4]*A[3][1]*A[0][3]*A[1][2]+A[0][3]*A[3][1]*A[1][4]*A[4][2];
	double i02 = t0*idet;
                                                  t0 = -A[1][1]*A[2][2]*A[4][4]*A[0][3]+A[1][1]*A[2][2]*A[0][4]*A[4][3]-A[1][1]*A[0][4]*A[4][2]*A[2][3]+A[1][1]*A[4][2]*A[2][4]*A[0][3]-A[1][1]*A[0][2]*A[2][4]*A[4][3]+A[1][1]*A[4][4]*A[0][2]*A[2][3]+A[2][2]*A[4][1]*A[1][4]*A[0][3]-A[2][2]*A[0][1]*A[1][4]*A[4][3]-A[2][2]*A[0][4]*A[4][1]*A[1][3]+A[2][2]*A[4][4]*A[0][1]*A[1][3]+A[4][4]*A[2][1]*A[0][3]*A[1][2]+A[0][2]*A[2][1]*A[1][4]*A[4][3]-A[4][1]*A[1][4]*A[0][2]*A[2][3]-A[4][4]*A[0][1]*A[1][2]*A[2][3]+A[0][4]*A[4][2]*A[1][3]*A[2][1]-A[4][2]*A[2][4]*A[0][1]*A[1][3]-A[4][1]*A[1][2]*A[2][4]*A[0][3]-A[4][4]*A[2][1]*A[0][2]*A[1][3]-A[4][2]*A[2][1]*A[1][4]*A[0][3]+A[0][1]*A[1][4]*A[4][2]*A[2][3]-A[0][4]*A[1][2]*A[2][1]*A[4][3]+A[0][1]*A[1][2]*A[2][4]*A[4][3]+A[0][2]*A[2][4]*A[4][1]*A[1][3]+A[0][4]*A[4][1]*A[1][2]*A[2][3];
	double i03 = t0*idet;
                                                  t0 = A[1][1]*A[2][2]*A[0][3]*A[3][4]-A[1][1]*A[2][2]*A[3][3]*A[0][4]+A[1][1]*A[3][3]*A[0][2]*A[2][4]-A[1][1]*A[0][3]*A[3][2]*A[2][4]-A[1][1]*A[0][2]*A[2][3]*A[3][4]+A[1][1]*A[2][3]*A[3][2]*A[0][4]+A[2][2]*A[3][1]*A[1][3]*A[0][4]-A[2][2]*A[0][1]*A[1][3]*A[3][4]-A[2][2]*A[0][3]*A[3][1]*A[1][4]+A[2][2]*A[3][3]*A[0][1]*A[1][4]+A[0][2]*A[2][3]*A[3][1]*A[1][4]+A[3][3]*A[1][2]*A[2][1]*A[0][4]-A[3][3]*A[0][1]*A[1][2]*A[2][4]-A[3][3]*A[0][2]*A[2][1]*A[1][4]-A[2][3]*A[3][2]*A[0][1]*A[1][4]+A[0][3]*A[1][2]*A[3][1]*A[2][4]+A[0][3]*A[3][2]*A[2][1]*A[1][4]+A[2][1]*A[0][2]*A[1][3]*A[3][4]-A[2][1]*A[1][3]*A[3][2]*A[0][4]-A[3][1]*A[1][3]*A[0][2]*A[2][4]-A[3][1]*A[1][2]*A[2][3]*A[0][4]+A[0][1]*A[1][3]*A[3][2]*A[2][4]+A[0][1]*A[1][2]*A[2][3]*A[3][4]-A[0][3]*A[1][2]*A[2][1]*A[3][4];
	double i04 = t0*idet;
                                                  t0 = -A[2][2]*A[1][4]*A[4][3]*A[3][0]-A[2][2]*A[3][3]*A[4][4]*A[1][0]-A[4][4]*A[2][0]*A[1][3]*A[3][2]+A[1][4]*A[4][3]*A[2][0]*A[3][2]-A[4][4]*A[3][0]*A[1][2]*A[2][3]-A[4][3]*A[3][4]*A[2][0]*A[1][2]-A[3][3]*A[1][2]*A[2][4]*A[4][0]+A[3][3]*A[4][2]*A[2][4]*A[1][0]-A[3][3]*A[1][4]*A[4][2]*A[2][0]-A[4][2]*A[2][4]*A[3][0]*A[1][3]-A[4][2]*A[2][3]*A[3][4]*A[1][0]+A[1][4]*A[4][2]*A[2][3]*A[3][0]+A[1][3]*A[3][2]*A[2][4]*A[4][0]+A[1][3]*A[3][4]*A[4][2]*A[2][0]+A[3][3]*A[4][4]*A[2][0]*A[1][2]+A[1][2]*A[2][4]*A[4][3]*A[3][0]-A[4][3]*A[3][2]*A[2][4]*A[1][0]+A[2][2]*A[3][3]*A[1][4]*A[4][0]+A[4][4]*A[1][0]*A[2][3]*A[3][2]-A[1][4]*A[2][3]*A[3][2]*A[4][0]+A[2][2]*A[4][3]*A[3][4]*A[1][0]-A[2][2]*A[1][3]*A[3][4]*A[4][0]+A[2][2]*A[4][4]*A[3][0]*A[1][3]+A[1][2]*A[2][3]*A[3][4]*A[4][0];
	double i10 = t0*idet;
                                                  t0 = A[0][0]*A[2][2]*A[4][4]*A[3][3]-A[0][0]*A[2][2]*A[4][3]*A[3][4]-A[0][0]*A[4][2]*A[2][4]*A[3][3]-A[0][0]*A[4][4]*A[2][3]*A[3][2]+A[0][0]*A[4][3]*A[3][2]*A[2][4]+A[0][0]*A[4][2]*A[2][3]*A[3][4]-A[2][2]*A[4][0]*A[0][4]*A[3][3]-A[2][2]*A[3][0]*A[0][3]*A[4][4]+A[2][2]*A[4][3]*A[3][0]*A[0][4]+A[2][2]*A[4][0]*A[0][3]*A[3][4]-A[3][3]*A[2][0]*A[0][2]*A[4][4]+A[3][3]*A[4][0]*A[0][2]*A[2][4]+A[3][3]*A[4][2]*A[2][0]*A[0][4]+A[2][0]*A[0][3]*A[3][2]*A[4][4]-A[4][0]*A[0][3]*A[3][2]*A[2][4]-A[4][3]*A[3][2]*A[2][0]*A[0][4]+A[3][0]*A[0][2]*A[2][3]*A[4][4]-A[4][3]*A[3][0]*A[0][2]*A[2][4]-A[4][0]*A[0][2]*A[2][3]*A[3][4]-A[4][2]*A[2][3]*A[3][0]*A[0][4]-A[4][2]*A[2][0]*A[0][3]*A[3][4]+A[4][3]*A[2][0]*A[0][2]*A[3][4]+A[3][0]*A[0][3]*A[4][2]*A[2][4]+A[4][0]*A[0][4]*A[2][3]*A[3][2];
	double i11 = t0*idet;
                                                  t0 = A[0][0]*A[3][3]*A[1][4]*A[4][2]-A[0][0]*A[3][3]*A[4][4]*A[1][2]-A[0][0]*A[1][4]*A[4][3]*A[3][2]+A[0][0]*A[4][4]*A[1][3]*A[3][2]-A[0][0]*A[1][3]*A[3][4]*A[4][2]+A[0][0]*A[4][3]*A[3][4]*A[1][2]+A[3][3]*A[4][0]*A[0][4]*A[1][2]-A[3][3]*A[1][0]*A[0][4]*A[4][2]+A[3][3]*A[4][4]*A[1][0]*A[0][2]-A[3][3]*A[1][4]*A[4][0]*A[0][2]-A[4][3]*A[3][4]*A[1][0]*A[0][2]+A[1][0]*A[0][3]*A[3][4]*A[4][2]+A[1][4]*A[4][3]*A[3][0]*A[0][2]+A[1][4]*A[4][0]*A[0][3]*A[3][2]-A[4][3]*A[3][0]*A[0][4]*A[1][2]+A[1][3]*A[3][0]*A[0][4]*A[4][2]-A[1][4]*A[3][0]*A[0][3]*A[4][2]+A[3][0]*A[0][3]*A[4][4]*A[1][2]+A[1][0]*A[0][4]*A[4][3]*A[3][2]+A[1][3]*A[3][4]*A[4][0]*A[0][2]-A[4][0]*A[0][4]*A[1][3]*A[3][2]-A[4][0]*A[0][3]*A[3][4]*A[1][2]-A[4][4]*A[1][0]*A[0][3]*A[3][2]-A[4][4]*A[3][0]*A[0][2]*A[1][3];
	double i12 = t0*idet;
                                                  t0 = -A[0][0]*A[2][2]*A[4][4]*A[1][3]+A[0][0]*A[2][2]*A[1][4]*A[4][3]+A[0][0]*A[4][2]*A[2][4]*A[1][3]-A[0][0]*A[1][4]*A[4][2]*A[2][3]-A[0][0]*A[1][2]*A[2][4]*A[4][3]+A[0][0]*A[4][4]*A[1][2]*A[2][3]+A[2][2]*A[4][0]*A[0][4]*A[1][3]-A[2][2]*A[1][0]*A[0][4]*A[4][3]+A[2][2]*A[4][4]*A[1][0]*A[0][3]-A[2][2]*A[1][4]*A[4][0]*A[0][3]+A[2][0]*A[0][2]*A[4][4]*A[1][3]-A[4][4]*A[2][0]*A[0][3]*A[1][2]-A[4][0]*A[0][2]*A[2][4]*A[1][3]+A[1][2]*A[2][4]*A[4][0]*A[0][3]-A[4][2]*A[2][4]*A[1][0]*A[0][3]-A[4][0]*A[0][4]*A[1][2]*A[2][3]+A[1][0]*A[0][2]*A[2][4]*A[4][3]-A[4][4]*A[1][0]*A[0][2]*A[2][3]+A[1][2]*A[2][0]*A[0][4]*A[4][3]+A[1][4]*A[4][0]*A[0][2]*A[2][3]+A[1][4]*A[4][2]*A[2][0]*A[0][3]+A[1][0]*A[0][4]*A[4][2]*A[2][3]-A[1][4]*A[2][0]*A[0][2]*A[4][3]-A[4][2]*A[2][0]*A[0][4]*A[1][3];
	double i13 = t0*idet;
                                                  t0 = -A[0][0]*A[2][2]*A[3][3]*A[1][4]+A[0][0]*A[2][2]*A[1][3]*A[3][4]+A[0][0]*A[3][3]*A[1][2]*A[2][4]-A[0][0]*A[1][3]*A[3][2]*A[2][4]+A[0][0]*A[2][3]*A[3][2]*A[1][4]-A[0][0]*A[1][2]*A[2][3]*A[3][4]+A[2][2]*A[3][3]*A[1][0]*A[0][4]+A[2][2]*A[3][0]*A[0][3]*A[1][4]-A[2][2]*A[1][3]*A[3][0]*A[0][4]-A[2][2]*A[1][0]*A[0][3]*A[3][4]-A[3][3]*A[1][2]*A[2][0]*A[0][4]+A[3][3]*A[2][0]*A[0][2]*A[1][4]-A[3][3]*A[1][0]*A[0][2]*A[2][4]-A[3][0]*A[0][2]*A[2][3]*A[1][4]-A[3][0]*A[0][3]*A[1][2]*A[2][4]+A[1][2]*A[2][3]*A[3][0]*A[0][4]+A[1][3]*A[3][0]*A[0][2]*A[2][4]+A[2][0]*A[0][3]*A[1][2]*A[3][4]+A[1][0]*A[0][2]*A[2][3]*A[3][4]+A[1][3]*A[3][2]*A[2][0]*A[0][4]-A[2][3]*A[3][2]*A[1][0]*A[0][4]-A[2][0]*A[0][3]*A[3][2]*A[1][4]-A[1][3]*A[2][0]*A[0][2]*A[3][4]+A[1][0]*A[0][3]*A[3][2]*A[2][4];
	double i14 = t0*idet;
                                                  t0 = -A[1][1]*A[3][3]*A[4][4]*A[2][0]+A[1][1]*A[3][3]*A[2][4]*A[4][0]-A[1][1]*A[2][4]*A[4][3]*A[3][0]-A[1][1]*A[2][3]*A[3][4]*A[4][0]+A[1][1]*A[4][4]*A[3][0]*A[2][3]+A[1][1]*A[4][3]*A[3][4]*A[2][0]-A[3][3]*A[2][1]*A[1][4]*A[4][0]+A[3][3]*A[4][1]*A[1][4]*A[2][0]+A[3][3]*A[4][4]*A[1][0]*A[2][1]-A[3][3]*A[2][4]*A[1][0]*A[4][1]+A[2][3]*A[3][4]*A[1][0]*A[4][1]-A[4][4]*A[1][0]*A[2][3]*A[3][1]+A[2][4]*A[4][1]*A[1][3]*A[3][0]+A[1][3]*A[2][1]*A[3][4]*A[4][0]+A[3][1]*A[1][3]*A[4][4]*A[2][0]-A[4][1]*A[1][4]*A[3][0]*A[2][3]-A[4][4]*A[3][0]*A[1][3]*A[2][1]+A[2][3]*A[3][1]*A[1][4]*A[4][0]+A[2][1]*A[1][4]*A[4][3]*A[3][0]-A[4][3]*A[3][1]*A[1][4]*A[2][0]-A[4][1]*A[1][3]*A[3][4]*A[2][0]+A[2][4]*A[4][3]*A[1][0]*A[3][1]-A[4][3]*A[3][4]*A[1][0]*A[2][1]-A[2][4]*A[3][1]*A[1][3]*A[4][0];
	double i20 = t0*idet;
                                                  t0 = -A[0][0]*A[3][3]*A[4][4]*A[2][1]-A[2][4]*A[3][0]*A[0][3]*A[4][1]-A[3][3]*A[2][4]*A[4][0]*A[0][1]-A[0][0]*A[2][3]*A[3][4]*A[4][1]+A[2][0]*A[0][4]*A[4][3]*A[3][1]+A[0][0]*A[4][3]*A[3][4]*A[2][1]+A[3][3]*A[4][4]*A[2][0]*A[0][1]+A[0][0]*A[3][3]*A[2][4]*A[4][1]+A[2][0]*A[0][3]*A[3][4]*A[4][1]+A[0][0]*A[4][4]*A[2][3]*A[3][1]+A[2][4]*A[4][3]*A[3][0]*A[0][1]+A[3][3]*A[4][0]*A[0][4]*A[2][1]-A[4][0]*A[0][3]*A[3][4]*A[2][1]-A[4][4]*A[2][0]*A[0][3]*A[3][1]+A[2][4]*A[4][0]*A[0][3]*A[3][1]-A[4][4]*A[3][0]*A[0][1]*A[2][3]-A[4][3]*A[3][0]*A[0][4]*A[2][1]-A[4][3]*A[3][4]*A[2][0]*A[0][1]+A[2][3]*A[3][0]*A[0][4]*A[4][1]-A[4][0]*A[0][4]*A[2][3]*A[3][1]+A[3][0]*A[0][3]*A[4][4]*A[2][1]-A[3][3]*A[2][0]*A[0][4]*A[4][1]-A[0][0]*A[2][4]*A[4][3]*A[3][1]+A[2][3]*A[3][4]*A[4][0]*A[0][1];
	double i21 = t0*idet;
                                                  t0 = A[0][0]*A[1][1]*A[4][4]*A[3][3]-A[0][0]*A[1][1]*A[4][3]*A[3][4]-A[0][0]*A[4][1]*A[1][4]*A[3][3]-A[0][0]*A[4][4]*A[1][3]*A[3][1]+A[0][0]*A[4][1]*A[1][3]*A[3][4]+A[0][0]*A[4][3]*A[3][1]*A[1][4]-A[1][1]*A[4][0]*A[0][4]*A[3][3]-A[1][1]*A[3][0]*A[0][3]*A[4][4]+A[1][1]*A[4][3]*A[3][0]*A[0][4]+A[1][1]*A[4][0]*A[0][3]*A[3][4]-A[3][3]*A[1][0]*A[0][1]*A[4][4]+A[3][3]*A[4][1]*A[1][0]*A[0][4]+A[3][3]*A[4][0]*A[0][1]*A[1][4]-A[4][3]*A[3][1]*A[1][0]*A[0][4]+A[3][0]*A[0][3]*A[4][1]*A[1][4]-A[4][1]*A[1][0]*A[0][3]*A[3][4]+A[4][0]*A[0][4]*A[1][3]*A[3][1]+A[3][0]*A[0][1]*A[1][3]*A[4][4]-A[4][0]*A[0][3]*A[3][1]*A[1][4]-A[4][3]*A[3][0]*A[0][1]*A[1][4]+A[1][0]*A[3][1]*A[0][3]*A[4][4]-A[4][0]*A[0][1]*A[1][3]*A[3][4]-A[4][1]*A[1][3]*A[3][0]*A[0][4]+A[4][3]*A[1][0]*A[0][1]*A[3][4];
	double i22 = t0*idet;
                                                  t0 = -A[0][0]*A[1][1]*A[4][4]*A[2][3]+A[0][0]*A[1][1]*A[2][4]*A[4][3]-A[0][0]*A[2][4]*A[4][1]*A[1][3]-A[0][0]*A[2][1]*A[1][4]*A[4][3]+A[0][0]*A[4][1]*A[1][4]*A[2][3]+A[0][0]*A[4][4]*A[1][3]*A[2][1]-A[1][1]*A[2][0]*A[0][4]*A[4][3]+A[1][1]*A[4][4]*A[2][0]*A[0][3]-A[1][1]*A[2][4]*A[4][0]*A[0][3]+A[1][1]*A[4][0]*A[0][4]*A[2][3]-A[4][1]*A[1][4]*A[2][0]*A[0][3]-A[2][4]*A[1][0]*A[0][1]*A[4][3]-A[4][0]*A[0][1]*A[1][4]*A[2][3]+A[2][1]*A[1][4]*A[4][0]*A[0][3]+A[2][0]*A[0][4]*A[4][1]*A[1][3]+A[2][1]*A[1][0]*A[0][4]*A[4][3]+A[2][0]*A[0][1]*A[1][4]*A[4][3]-A[4][4]*A[1][0]*A[0][3]*A[2][1]-A[4][4]*A[2][0]*A[0][1]*A[1][3]-A[4][0]*A[0][4]*A[1][3]*A[2][1]+A[2][4]*A[4][0]*A[0][1]*A[1][3]-A[4][1]*A[1][0]*A[0][4]*A[2][3]+A[1][0]*A[0][1]*A[4][4]*A[2][3]+A[2][4]*A[4][1]*A[1][0]*A[0][3];
	double i23 = t0*idet;
                                                  t0 = -A[0][0]*A[1][1]*A[3][3]*A[2][4]+A[0][0]*A[1][1]*A[2][3]*A[3][4]+A[0][0]*A[3][3]*A[2][1]*A[1][4]-A[0][0]*A[2][3]*A[3][1]*A[1][4]-A[0][0]*A[1][3]*A[2][1]*A[3][4]+A[0][0]*A[3][1]*A[1][3]*A[2][4]+A[1][1]*A[3][3]*A[2][0]*A[0][4]-A[1][1]*A[2][0]*A[0][3]*A[3][4]+A[1][1]*A[3][0]*A[0][3]*A[2][4]-A[1][1]*A[2][3]*A[3][0]*A[0][4]+A[3][3]*A[1][0]*A[0][1]*A[2][4]-A[3][3]*A[2][0]*A[0][1]*A[1][4]-A[3][3]*A[2][1]*A[1][0]*A[0][4]-A[1][0]*A[3][1]*A[0][3]*A[2][4]+A[2][0]*A[0][3]*A[3][1]*A[1][4]-A[3][1]*A[1][3]*A[2][0]*A[0][4]+A[2][0]*A[0][1]*A[1][3]*A[3][4]+A[2][3]*A[3][1]*A[1][0]*A[0][4]-A[2][3]*A[1][0]*A[0][1]*A[3][4]+A[1][3]*A[2][1]*A[3][0]*A[0][4]-A[3][0]*A[0][1]*A[1][3]*A[2][4]-A[3][0]*A[0][3]*A[2][1]*A[1][4]+A[2][3]*A[3][0]*A[0][1]*A[1][4]+A[1][0]*A[0][3]*A[2][1]*A[3][4];
	double i24 = t0*idet;
                                                  t0 = A[1][1]*A[2][2]*A[3][4]*A[4][0]-A[1][1]*A[2][2]*A[4][4]*A[3][0]-A[1][1]*A[3][4]*A[4][2]*A[2][0]-A[1][1]*A[3][2]*A[2][4]*A[4][0]+A[1][1]*A[4][4]*A[2][0]*A[3][2]+A[1][1]*A[4][2]*A[2][4]*A[3][0]-A[2][2]*A[3][1]*A[1][4]*A[4][0]-A[2][2]*A[3][4]*A[1][0]*A[4][1]+A[2][2]*A[4][4]*A[1][0]*A[3][1]+A[2][2]*A[4][1]*A[1][4]*A[3][0]-A[4][1]*A[1][4]*A[2][0]*A[3][2]-A[4][4]*A[2][0]*A[1][2]*A[3][1]+A[3][4]*A[4][2]*A[1][0]*A[2][1]+A[3][2]*A[2][4]*A[1][0]*A[4][1]+A[4][4]*A[3][0]*A[1][2]*A[2][1]-A[4][2]*A[2][4]*A[1][0]*A[3][1]-A[4][1]*A[1][2]*A[2][4]*A[3][0]+A[1][2]*A[3][1]*A[2][4]*A[4][0]-A[4][4]*A[1][0]*A[2][1]*A[3][2]+A[3][1]*A[1][4]*A[4][2]*A[2][0]+A[3][2]*A[2][1]*A[1][4]*A[4][0]+A[3][4]*A[4][1]*A[1][2]*A[2][0]-A[4][2]*A[2][1]*A[1][4]*A[3][0]-A[3][4]*A[1][2]*A[2][1]*A[4][0];
	double i30 = t0*idet;
                                                  t0 = -A[0][0]*A[2][2]*A[4][4]*A[3][1]+A[0][0]*A[2][2]*A[3][4]*A[4][1]+A[0][0]*A[4][4]*A[2][1]*A[3][2]-A[0][0]*A[3][2]*A[2][4]*A[4][1]+A[0][0]*A[4][2]*A[2][4]*A[3][1]-A[0][0]*A[3][4]*A[4][2]*A[2][1]-A[2][2]*A[3][4]*A[4][0]*A[0][1]+A[2][2]*A[4][0]*A[0][4]*A[3][1]-A[2][2]*A[3][0]*A[0][4]*A[4][1]+A[2][2]*A[4][4]*A[3][0]*A[0][1]-A[3][4]*A[2][0]*A[0][2]*A[4][1]-A[4][0]*A[0][4]*A[2][1]*A[3][2]-A[4][4]*A[2][0]*A[0][1]*A[3][2]-A[4][2]*A[2][4]*A[3][0]*A[0][1]+A[2][0]*A[0][2]*A[4][4]*A[3][1]-A[4][0]*A[0][2]*A[2][4]*A[3][1]-A[4][2]*A[2][0]*A[0][4]*A[3][1]+A[3][2]*A[2][4]*A[4][0]*A[0][1]-A[4][4]*A[3][0]*A[0][2]*A[2][1]+A[3][4]*A[4][2]*A[2][0]*A[0][1]+A[3][2]*A[2][0]*A[0][4]*A[4][1]+A[3][0]*A[0][2]*A[2][4]*A[4][1]+A[3][4]*A[4][0]*A[0][2]*A[2][1]+A[3][0]*A[0][4]*A[4][2]*A[2][1];
	double i31 = t0*idet;
                                                  t0 = -A[0][0]*A[1][1]*A[4][4]*A[3][2]+A[0][0]*A[1][1]*A[3][4]*A[4][2]+A[0][0]*A[4][4]*A[1][2]*A[3][1]-A[0][0]*A[3][1]*A[1][4]*A[4][2]+A[0][0]*A[4][1]*A[1][4]*A[3][2]-A[0][0]*A[3][4]*A[4][1]*A[1][2]-A[1][1]*A[3][4]*A[4][0]*A[0][2]-A[1][1]*A[3][0]*A[0][4]*A[4][2]+A[1][1]*A[4][0]*A[0][4]*A[3][2]+A[1][1]*A[4][4]*A[3][0]*A[0][2]+A[3][4]*A[4][1]*A[1][0]*A[0][2]+A[3][0]*A[0][1]*A[1][4]*A[4][2]-A[4][1]*A[1][4]*A[3][0]*A[0][2]+A[3][4]*A[4][0]*A[0][1]*A[1][2]+A[3][0]*A[0][4]*A[4][1]*A[1][2]-A[3][4]*A[1][0]*A[0][1]*A[4][2]-A[4][0]*A[0][4]*A[1][2]*A[3][1]+A[1][0]*A[0][1]*A[4][4]*A[3][2]-A[4][0]*A[0][1]*A[1][4]*A[3][2]+A[3][1]*A[1][0]*A[0][4]*A[4][2]-A[4][4]*A[1][0]*A[0][2]*A[3][1]-A[4][4]*A[3][0]*A[0][1]*A[1][2]+A[3][1]*A[1][4]*A[4][0]*A[0][2]-A[4][1]*A[1][0]*A[0][4]*A[3][2];
	double i32 = t0*idet;
                                                  t0 = A[0][0]*A[1][1]*A[4][4]*A[2][2]-A[0][0]*A[1][1]*A[4][2]*A[2][4]-A[0][0]*A[4][1]*A[1][4]*A[2][2]+A[0][0]*A[4][1]*A[1][2]*A[2][4]+A[0][0]*A[4][2]*A[2][1]*A[1][4]-A[0][0]*A[1][2]*A[2][1]*A[4][4]-A[1][1]*A[4][0]*A[0][4]*A[2][2]-A[1][1]*A[2][0]*A[0][2]*A[4][4]+A[1][1]*A[4][0]*A[0][2]*A[2][4]+A[1][1]*A[4][2]*A[2][0]*A[0][4]-A[2][2]*A[1][0]*A[0][1]*A[4][4]+A[2][2]*A[4][1]*A[1][0]*A[0][4]+A[2][2]*A[4][0]*A[0][1]*A[1][4]+A[4][2]*A[1][0]*A[0][1]*A[2][4]-A[4][0]*A[0][1]*A[1][2]*A[2][4]-A[4][2]*A[2][1]*A[1][0]*A[0][4]-A[4][0]*A[0][2]*A[2][1]*A[1][4]+A[2][0]*A[0][1]*A[1][2]*A[4][4]+A[1][2]*A[2][1]*A[4][0]*A[0][4]-A[4][1]*A[1][0]*A[0][2]*A[2][4]+A[2][0]*A[0][2]*A[4][1]*A[1][4]-A[4][2]*A[2][0]*A[0][1]*A[1][4]+A[1][0]*A[0][2]*A[2][1]*A[4][4]-A[4][1]*A[1][2]*A[2][0]*A[0][4];
	double i33 = t0*idet;
                                                  t0 = -A[0][0]*A[1][1]*A[2][2]*A[3][4]+A[0][0]*A[1][1]*A[3][2]*A[2][4]+A[0][0]*A[2][2]*A[3][1]*A[1][4]+A[0][0]*A[1][2]*A[2][1]*A[3][4]-A[0][0]*A[1][2]*A[3][1]*A[2][4]-A[0][0]*A[3][2]*A[2][1]*A[1][4]+A[1][1]*A[2][2]*A[3][0]*A[0][4]-A[1][1]*A[3][0]*A[0][2]*A[2][4]+A[1][1]*A[2][0]*A[0][2]*A[3][4]-A[1][1]*A[3][2]*A[2][0]*A[0][4]+A[2][2]*A[1][0]*A[0][1]*A[3][4]-A[2][2]*A[3][0]*A[0][1]*A[1][4]-A[2][2]*A[3][1]*A[1][0]*A[0][4]+A[3][0]*A[0][1]*A[1][2]*A[2][4]-A[2][0]*A[0][2]*A[3][1]*A[1][4]-A[1][0]*A[0][2]*A[2][1]*A[3][4]-A[2][0]*A[0][1]*A[1][2]*A[3][4]+A[3][2]*A[2][0]*A[0][1]*A[1][4]+A[1][2]*A[3][1]*A[2][0]*A[0][4]+A[3][0]*A[0][2]*A[2][1]*A[1][4]+A[1][0]*A[0][2]*A[3][1]*A[2][4]+A[3][2]*A[2][1]*A[1][0]*A[0][4]-A[1][2]*A[2][1]*A[3][0]*A[0][4]-A[3][2]*A[1][0]*A[0][1]*A[2][4];
	double i34 = t0*idet;
                                                  t0 = A[1][1]*A[2][2]*A[4][3]*A[3][0]-A[1][1]*A[2][2]*A[3][3]*A[4][0]-A[1][1]*A[4][3]*A[2][0]*A[3][2]-A[1][1]*A[4][2]*A[2][3]*A[3][0]+A[1][1]*A[3][3]*A[4][2]*A[2][0]+A[1][1]*A[2][3]*A[3][2]*A[4][0]-A[2][2]*A[4][3]*A[1][0]*A[3][1]+A[2][2]*A[3][3]*A[1][0]*A[4][1]+A[2][2]*A[3][1]*A[1][3]*A[4][0]-A[2][2]*A[4][1]*A[1][3]*A[3][0]-A[3][3]*A[4][2]*A[1][0]*A[2][1]+A[4][3]*A[1][0]*A[2][1]*A[3][2]+A[4][3]*A[2][0]*A[1][2]*A[3][1]+A[4][1]*A[1][2]*A[2][3]*A[3][0]+A[4][1]*A[1][3]*A[2][0]*A[3][2]-A[3][3]*A[4][1]*A[1][2]*A[2][0]+A[3][3]*A[1][2]*A[2][1]*A[4][0]-A[2][3]*A[3][2]*A[1][0]*A[4][1]-A[2][1]*A[1][3]*A[3][2]*A[4][0]-A[3][1]*A[1][3]*A[4][2]*A[2][0]-A[4][3]*A[3][0]*A[1][2]*A[2][1]+A[4][2]*A[2][3]*A[1][0]*A[3][1]-A[3][1]*A[1][2]*A[2][3]*A[4][0]+A[4][2]*A[1][3]*A[2][1]*A[3][0];
	double i40 = t0*idet;
                                                  t0 = -A[0][0]*A[2][2]*A[3][3]*A[4][1]+A[0][0]*A[2][2]*A[4][3]*A[3][1]-A[0][0]*A[4][3]*A[2][1]*A[3][2]-A[0][0]*A[4][2]*A[2][3]*A[3][1]+A[0][0]*A[3][3]*A[4][2]*A[2][1]+A[0][0]*A[2][3]*A[3][2]*A[4][1]-A[2][2]*A[4][0]*A[0][3]*A[3][1]+A[2][2]*A[3][0]*A[0][3]*A[4][1]-A[2][2]*A[4][3]*A[3][0]*A[0][1]+A[2][2]*A[3][3]*A[4][0]*A[0][1]+A[4][3]*A[3][0]*A[0][2]*A[2][1]-A[3][3]*A[4][0]*A[0][2]*A[2][1]+A[3][3]*A[2][0]*A[0][2]*A[4][1]+A[4][2]*A[2][0]*A[0][3]*A[3][1]+A[4][0]*A[0][3]*A[2][1]*A[3][2]-A[3][3]*A[4][2]*A[2][0]*A[0][1]-A[2][3]*A[3][2]*A[4][0]*A[0][1]+A[4][3]*A[2][0]*A[0][1]*A[3][2]-A[3][0]*A[0][3]*A[4][2]*A[2][1]+A[4][0]*A[0][2]*A[2][3]*A[3][1]-A[2][0]*A[0][3]*A[3][2]*A[4][1]-A[3][0]*A[0][2]*A[2][3]*A[4][1]-A[4][3]*A[2][0]*A[0][2]*A[3][1]+A[4][2]*A[2][3]*A[3][0]*A[0][1];
	double i41 = t0*idet;
                                                  t0 = A[0][0]*A[1][1]*A[4][3]*A[3][2]-A[0][0]*A[1][1]*A[3][3]*A[4][2]-A[0][0]*A[4][1]*A[1][3]*A[3][2]+A[0][0]*A[3][3]*A[4][1]*A[1][2]-A[0][0]*A[4][3]*A[1][2]*A[3][1]+A[0][0]*A[3][1]*A[1][3]*A[4][2]+A[1][1]*A[3][3]*A[4][0]*A[0][2]+A[1][1]*A[3][0]*A[0][3]*A[4][2]-A[1][1]*A[4][3]*A[3][0]*A[0][2]-A[1][1]*A[4][0]*A[0][3]*A[3][2]-A[3][3]*A[4][1]*A[1][0]*A[0][2]+A[4][0]*A[0][3]*A[1][2]*A[3][1]-A[1][0]*A[3][1]*A[0][3]*A[4][2]-A[3][3]*A[4][0]*A[0][1]*A[1][2]+A[3][3]*A[1][0]*A[0][1]*A[4][2]+A[4][3]*A[3][0]*A[0][1]*A[1][2]-A[3][0]*A[0][3]*A[4][1]*A[1][2]+A[4][1]*A[1][0]*A[0][3]*A[3][2]-A[3][0]*A[0][1]*A[1][3]*A[4][2]-A[3][1]*A[1][3]*A[4][0]*A[0][2]+A[4][1]*A[1][3]*A[3][0]*A[0][2]+A[4][3]*A[1][0]*A[0][2]*A[3][1]+A[4][0]*A[0][1]*A[1][3]*A[3][2]-A[4][3]*A[1][0]*A[0][1]*A[3][2];
	double i42 = t0*idet;
                                                  t0 = -A[0][0]*A[1][1]*A[2][2]*A[4][3]+A[0][0]*A[1][1]*A[4][2]*A[2][3]-A[0][0]*A[4][2]*A[1][3]*A[2][1]-A[0][0]*A[4][1]*A[1][2]*A[2][3]+A[0][0]*A[2][2]*A[4][1]*A[1][3]+A[0][0]*A[1][2]*A[2][1]*A[4][3]+A[1][1]*A[2][0]*A[0][2]*A[4][3]-A[1][1]*A[4][2]*A[2][0]*A[0][3]-A[1][1]*A[4][0]*A[0][2]*A[2][3]+A[1][1]*A[2][2]*A[4][0]*A[0][3]+A[4][2]*A[2][0]*A[0][1]*A[1][3]+A[4][1]*A[1][2]*A[2][0]*A[0][3]+A[4][0]*A[0][1]*A[1][2]*A[2][3]+A[4][1]*A[1][0]*A[0][2]*A[2][3]-A[2][2]*A[4][1]*A[1][0]*A[0][3]+A[2][2]*A[1][0]*A[0][1]*A[4][3]-A[2][2]*A[4][0]*A[0][1]*A[1][3]-A[1][2]*A[2][1]*A[4][0]*A[0][3]-A[1][0]*A[0][2]*A[2][1]*A[4][3]-A[2][0]*A[0][2]*A[4][1]*A[1][3]-A[2][0]*A[0][1]*A[1][2]*A[4][3]-A[4][2]*A[1][0]*A[0][1]*A[2][3]+A[4][2]*A[1][0]*A[0][3]*A[2][1]+A[4][0]*A[0][2]*A[1][3]*A[2][1];
	double i43 = t0*idet;
                                                  t0 = A[0][0]*A[1][1]*A[2][2]*A[3][3]-A[0][0]*A[1][1]*A[2][3]*A[3][2]-A[0][0]*A[2][1]*A[1][2]*A[3][3]+A[0][0]*A[2][1]*A[1][3]*A[3][2]+A[0][0]*A[3][1]*A[1][2]*A[2][3]-A[0][0]*A[3][1]*A[1][3]*A[2][2]-A[1][0]*A[0][1]*A[2][2]*A[3][3]+A[1][0]*A[0][1]*A[2][3]*A[3][2]+A[1][0]*A[2][1]*A[0][2]*A[3][3]-A[1][0]*A[2][1]*A[0][3]*A[3][2]-A[1][0]*A[3][1]*A[0][2]*A[2][3]+A[1][0]*A[3][1]*A[0][3]*A[2][2]+A[2][0]*A[0][1]*A[1][2]*A[3][3]-A[2][0]*A[0][1]*A[1][3]*A[3][2]-A[2][0]*A[1][1]*A[0][2]*A[3][3]+A[2][0]*A[1][1]*A[0][3]*A[3][2]+A[2][0]*A[3][1]*A[0][2]*A[1][3]-A[2][0]*A[3][1]*A[0][3]*A[1][2]-A[3][0]*A[0][1]*A[1][2]*A[2][3]+A[3][0]*A[0][1]*A[1][3]*A[2][2]+A[3][0]*A[1][1]*A[0][2]*A[2][3]-A[3][0]*A[1][1]*A[0][3]*A[2][2]-A[3][0]*A[2][1]*A[0][2]*A[1][3]+A[3][0]*A[2][1]*A[0][3]*A[1][2];
	double i44 = t0*idet;
	for(unsigned int i=0; i < x.num_cols(); i++)
	{
		x[0][i] = i00*b[0][i] + i01*b[1][i] + i02*b[2][i] + i03*b[3][i] + i04*b[4][i];
		x[1][i] = i10*b[0][i] + i11*b[1][i] + i12*b[2][i] + i13*b[3][i] + i14*b[4][i];
		x[2][i] = i20*b[0][i] + i21*b[1][i] + i22*b[2][i] + i23*b[3][i] + i24*b[4][i];
		x[3][i] = i30*b[0][i] + i31*b[1][i] + i32*b[2][i] + i33*b[3][i] + i34*b[4][i];
		x[4][i] = i40*b[0][i] + i41*b[1][i] + i42*b[2][i] + i43*b[3][i] + i44*b[4][i];
	}
}
static const int highest_solver= 5;
